package com.xqh.config;

import com.xqh.commom.taglib.PermissionDirective;
import freemarker.template.Configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * freemarker自定义标签
 */
@Component
public class FreemarkerConfig {

    @Autowired
    private Configuration configuration;

    @Autowired
    private PermissionDirective permissionDirective;

    @PostConstruct
    public void setSharedVariable(){
        configuration.setSharedVariable("permission", permissionDirective);
    }





}
